<template>
	<up-navbar :leftIcon="props.iconLeft ? 'arrow-left' : ''" leftIconColor="#fff" @leftClick="leftClick"
		:placeholder="true" :title="navbarTitle" :bgColor="'#0081ff'" :titleStyle="{ color: '#fff' }">
	</up-navbar>
</template>

<script setup>
import { ref, reactive } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
const props = defineProps({
	title: {
		required: false,
		type: String,
	},
	iconLeft: {
		type: Boolean,
		default: false
	},
})
function leftClick() {
	if (props.iconLeft) {
		uni.navigateBack({
			delta: 1, // 返回的页面层数，1 表示返回上一级
		});
	}
}
const navbarTitle = ref('')
onLoad(option => {
	navbarTitle.value = option.text? option.text:props.title
})
</script>
